package com.iplant.ams.service.basicenum.dms.scada;


import com.iplant.base.po.enums.BaseEnum;

/**
 * 采集模式 
 */
public enum DMSDataClass implements BaseEnum {
    /**
     * 默认
     */
    Default(0, "默认"),

    /**
     * 实时状态
     */
    Status(1, "实时状态"),
    /**
     * 实时报警
     */
    Alarm(2, "实时报警"),
    /**
     * 实时参数
     */
    Params(3, "实时参数"),
    /**
     * 作业参数
     */
    WorkParams(4, "作业参数"),
    /**
     * 能源参数
     */
    PowerParams(5, "能源参数"),
    /**
     * 质量参数
     */
    QualityParams(6, "质量参数"),
    /**
     * 控制参数
     */
    ControlData(7, "控制参数"),
    /**
     * 工艺参数
     */
    TechnologyData(8, "工艺参数"),
    /**
     * 位置参数
     */
    PositionData(9, "位置参数");

    private int value;
    private String label;
    private String remark = "";

    DMSDataClass(int value, String label) {
        this.value = value;
        this.label = label;
    }

    public static DMSDataClass getEnumType(int val) {
        for (DMSDataClass type : DMSDataClass.values()) {
            if (type.getValue() == val) {
                return type;
            }
        }
        return Default;
    }

    @Override
    public int getValue() {
        return value;
    }

    @Override
    public void setValue(int value) {
        this.value = value;
    }

    @Override
    public String getLabel() {
        return label;
    }

    @Override
    public void setLabel(String label) {
        this.label = label;
    }

    @Override
    public String getRemark() {
        return remark;
    }

    @Override
    public void setRemark(String remark) {
        this.remark = remark;
    }



    public  static String GetMysqlTablePrefixString( int wDataClass)
    {

        DMSDataClass wDMSDataClass = DMSDataClass.getEnumType(wDataClass);
         
        return wDMSDataClass.GetMysqlTablePrefixString();

    }

    public  String GetMysqlTablePrefixString()
    {
        String wString = "dms_device_";
        switch (this)
        {
            case Default:
                wString += "default";
                break;
            case Status:
                wString += "status";
                break;
            case Alarm:
                wString += "alarm";
                break;
            case Params:
                wString += "params";
                break;
            case WorkParams:
                wString += "workparams";
                break;
            case PowerParams:
                wString += "powerparams";
                break;
            case QualityParams:
                wString += "qualityparams";
                break;
            case ControlData:
                wString += "controldata";
                break;
            case TechnologyData:
                wString += "technology";
                break;
            case PositionData:
                wString += "position";
                break;
            default:
                wString += "default";
                break;
        }
        return wString;

    }
}
